Skip to content

Fix ext/mysql test failed 5.4+ - #175

Closed
reeze wants to merge 1 commit into
php:PHP-5.4from
reeze:fix-mysql-5.4+
Closed

reeze wants to merge 1 commit into
php:PHP-5.4from
reeze:fix-mysql-5.4+

Conversation

@reeze

@reeze reeze commented Aug 21, 2012

Copy link
Copy Markdown
Contributor

The same as #174, it could been apply to 5.4&master

@travisbot

Copy link
Copy Markdown

This pull request fails (merged 80d0ca5 into d304527).

@laruence

Copy link
Copy Markdown
Member

same reason as #174. your fix is not proper.

you can close it by yourself, or I will close it later. thanks

@reeze reeze closed this Aug 21, 2012
@reeze

reeze commented Aug 21, 2012

Copy link
Copy Markdown
Contributor Author

that was include_once.
anyway. close them :)

heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
…its interface is expected

Problem

Review of php#175 found three problems. A law that calls an interface method proved `p.amount() == p.amount()` even when
the implementation returns `random_int(…)`: each interface method was one `opaque` function, so Lean took two calls on
one value as equal, though an implementation can have effects. Spec section 28's `state-machine-law`, called with a
class that implements `Payment` as its event, was refused with "Lean refused the module … This is a bug in Mago",
because the generated code passed an `App.Shop.Card` where `App.Shop.Payment` was expected. And the limit row passed
with Mago's own limit on Lean removed, since every Lean process inherits the limit the test sets on `mago`.

Solution

A call of an interface method in a law is refused as `unmodeled-construct`, as an inherited method is: "Law alwaysSame
reaches the interface method Payment.amount in Card.same. Mago does not translate interface methods to Lean, because
an implementation can have effects." An interface stays a type Lean knows nothing about.

Each class, enum and interface that a law reaches declares, right after its own declaration, a `Coe` to each PHP#
interface its header names that a law reaches. The value it gives is `Sharp.upcast`'s, an `opaque` function of which
Lean knows nothing, as of every interface value, so the coercion proves nothing false.

A unit test runs a child through `Lake::command` and reads its processor-time limit as 120 seconds and its core-file
limit as 0. With the `pre_exec` limit removed it reads "unlimited". The limit row keeps the reporting paths only it
covers: an endless rule at its name, an endless `#eval`, an endless proof and the ten slow rules. Its comment says
that Mago's own limit is the unit test's to prove, since Mago takes the lower of 120 seconds and the limit it inherits.

crates/sharp-lean/
├── lean/Sharp/Lean/Interface.lean   upcast; no longer says two interfaces' values are never the same type
└── src/
    ├── issues.rs                    INTERFACE_METHOD
    ├── library.rs                   the unit test of the limit on each process a Lake starts
    └── translate/
        ├── body.rs                  overridable: a call of an interface method is refused with its own reason
        └── mod.rs                   no opaque methods; a Coe to each interface a class, enum or interface implements
tests/compile.rs                     the class-as-event row, the interface-call rows, the limit row's comment
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
fix: Lean work stops at a processor-time limit, concurrent first calls to lake take turns, and laws reach interfaces
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
At 164ef44, LINUX failed class-law and module-law: both compiled a law at once, and the image's elan installed Lean twice into one folder. mago-sharp php#175 makes concurrent first calls to lake take turns, so the pull goes on to 3cc39cc, its merge. php#175 also lets a law reach an interface, so state-machine-law passes and leaves sharp/baseline/spec.

Co-Authored-By: Claude <noreply@anthropic.com>
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
Master brings #114: the engine runs section 12's collection methods
and index places, and `sharp/mago/` moves to mago-sharp 3cc39cc. It
updates the five engine fixtures that the slice's Mago refused, so
`mago compile` compiles all 111 again. 3cc39cc also brings mago-sharp
php#175 and php#177, which git merged into the slice's Mago without a
conflict.

Six files conflicted, and each keeps both sides:
- `ext/sharp/sharp_arginfo.h` is regenerated from the merged
  `sharp.stub.php`, which holds master's `insert`, `removeAt`, `put` and
  `clear` and the slice's `\Sharp\Internal` functions.
- `index_read.inc` keeps master's two `count` calls and the slice's
  three `standing` calls.
- `enum_keys.phpt` and its two JIT twins keep the slice's `TypeError`:
  the Map's check refuses the key "missing" where plain PHP hands the
  Map in, before master's loop would convert it. Master's new `nest`
  line moves `byName` to line 67. `enum_keys.inc`'s comment that plain
  PHP collections are not checked is no longer true, and now says where
  the key fails.
- `opcodes.phpt` keeps master's 16 op arrays for `EnumKeys` and the
  slice's check lines, with one for each of master's `grouped` and
  `groupNames`.

Zend/tests/sharp/
├── enum_keys.inc                   <- the comment says where the key fails
├── enum_keys.phpt, enum_keys_jit_function.phpt, enum_keys_jit_tracing.phpt
│                                   <- the slice's TypeError, at line 67
├── index_read.inc                  <- both sides' calls
└── opcodes.phpt                    <- master's count, the slice's checks
ext/sharp/sharp_arginfo.h           <- regenerated from the merged stub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants